/*
 * Copyright (C) 2025 Tsingteng MicroSystem
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/**
 * @file nfa_utils.h
 * @brief 对外提供的NFA相关工具函数
 */

#ifndef _NFA_UTILS_H_
#define _NFA_UTILS_H_

#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */

#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>

/**
 * @brief 对外返回的数据的结构体
 *
 * @note 此结构体需要调用nfa_utils_free_rsp函数释放
 */
typedef struct {
    /** @brief 数据长度 */
    uint32_t len;
    /** @brief 数据指针 */
    uint8_t *data;
} tNCI_RSP;

/**
 * @brief 释放tNCI_RSP结构体
 *
 * @param rsp tNCI_RSP结构体指针
 * @param only_free_data 是否只释放rsp->data，不释放rsp本身
 */
void nfa_utils_free_rsp(tNCI_RSP *rsp, bool only_free_data);

#ifdef __cplusplus
}
#endif /* __cplusplus */

#endif // _NFA_UTILS_H_
